package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class CopyDemo2 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("XYY04135.JPG");
        FileOutputStream fos = new FileOutputStream("iXYY04135_cp.JPG");
        byte [] data = new byte[100000];
        int d ;
        long i=System.currentTimeMillis();
        while ((d=fis.read(data)) != -1){
            fos.write(data,0,d);
        }
        System.out.println(System.currentTimeMillis()-i+"ms");
        System.out.println("复制完毕");
        fis.close();
        fos.close();
    }
}
